package com.koro.conterller;

import com.koro.service.WeatherService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.io.IOException;

/**
 * @author HQ
 */
@RestController
@RequestMapping("/test")
public class TestController {

    @Autowired
    private WeatherService weatherService;

    @GetMapping("/weather")
    public String weatherTest(String cityName) throws IOException {
        return weatherService.getWeather(cityName);
    }

    @GetMapping("/route")
    public String routePlanTest(String originAddress,String destAddress,String mode) {
        return weatherService.getRoutePlan(originAddress,destAddress,mode);
    }
}
